<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* .langs {
            display: none;
        } */
    </style>
</head>
<body>
    <button class="select">选择语言</button>
    <ul class="langs" hidden>
        <li>汉语</li>
        <li>英语</li>
        <li>俄语</li>
        <li>法语</li>
        <li>德语</li>
    </ul>

    <script>
        var btn = document.querySelector('.select');
        var langs = document.querySelector('.langs');
        btn.addEventListener('click', function() {
            langs.style.display = 'block';
            // 阻止冒泡
            var e = event;
            e.stopPropagation();
            e.cancelBubble = true;
        })

        // 点击空白处 隐藏语言选项
        document.addEventListener('click', function() {
            langs.style.display = 'none'
        })
    </script>
</body>
</html>